home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
003
/
db3debug.arc
/
READTHIS.PRG
< prev
Wrap
Text File
|
1986-04-29
|
2KB
|
94 lines
DEBUGGER.PRG
This program is quite simple to use and works on all dBASE III
programs. The DEBUGGER will list and modify each line of your
program file.
1. All commands and text are put into uppercase.
2. All IF, ENDIF, DO WHILE, ENDDO, DO CASE, ENDCASE
statements will be paired up and attempted to be
matched. If there is an unmatched pair, you will
be informed of the mismatched pair.
3. You have the option of a hardcopy of the newly
debugged program. The hardcopy will have line numbers
for easier debugging.
4. All the lines of your code will be intented for easier
debugging and just plain good programming style.
Below, are two examples of how DEBUGGER works. The
first display shows the program in it rough state.
the second, after it was run through DEBUGGER.
Unedited program :
clear
select 1
set index TO LAST
do while .T.
store ' ' to answer
@ 10,15 say 'Type P for printer. S for screen'
@ 12,20 get answer picture '!'
@ 16,15 say 'or press RETURN for previous menu.'
read
clear
if answer=' '
clear
return
endif
if answer ='S'
go top
do rpt2
clear
else
clear
@ 10,15 say 'Please wait. Currently printing...'
do rpt1.prg
clear
endif
enddo
return
è
Revised program :
CLEAR
SELECT 1
SET INDEX TO LAST
DO WHILE .T.
STORE ' ' TO ANSWER
@ 10,15 SAY 'TYPE P FOR PRINTER. S FOR SCREEN'
@ 12,20 GET ANSWER PICTURE '!'
@ 16,15 SAY 'OR PRESS RETURN FOR PREVIOUS MENU.'
READ
CLEAR
IF ANSWER=' '
CLEAR
RETURN
ENDIF
IF ANSWER ='S'
GO TOP
DO RPT2
CLEAR
ELSE
CLEAR
@ 10,15 SAY 'PLEASE WAIT. CURRENTLY PRINTING...'
DO RPT1.PRG
CLEAR
ENDIF
ENDDO
RETURN
To start DEBUGGER simply type DO DEBUGGER at the dBASE dot prompt.
Enjoy!